package org.example.mybatis.domain;

import java.time.LocalDateTime;

public class User {
    //当执行 SELECT * FROM user 时，MyBatis 会自动把下面每一行封装成一个 User 对象
    private Integer id;
    private String name;
    private Integer age;
    private String sex;
    private LocalDateTime creatTime;

    // Getter 和 Setter
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public Integer getAge() { return age; }
    public void setAge(Integer age) { this.age = age; }

    public String getSex() { return sex; }
    public void setSex(String sex) { this.sex = sex; }

    public LocalDateTime getCreatTime() { return creatTime; }
    public void setCreatTime(LocalDateTime creatTime) { this.creatTime = creatTime; }
}

//5.实体类：一一对应数据库表的字段，用来接收和传递数据，相当于数据库表在Java中的镜像